﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Administrator.Master" AutoEventWireup="true" CodeBehind="EditSurvey.aspx.cs" Inherits="ProjectSemIII.Administrator.Survey.EditSurvey" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    Edit Survey
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="pagination">
        <asp:Label Text="Error dfgserfg jdksgbjksdb fjrkwb fvkjs bdjvkr t" runat="server" ID="lbError"></asp:Label>
    </div>
    <div class="fluid">
        <form id="validate" class="main" method="post" action="POST">
            <fieldset>
                <div class="widget">
                    <div class="whead">
                        <h6>Survey Information</h6>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Survey Catalog:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <div class="selector">
                                <span runat="server" id="spanCatalogName">Select Catalog Name</span>
                                <asp:DropDownList AutoPostBack="true" OnSelectedIndexChanged="ddSurveyCatalog_SelectedIndexChanged" runat="server" CssClass="validate[required]" ID="ddSurveyCatalog">
                                    <asp:ListItem Selected="True" Text="Select Group Join Survey" Value="-1"></asp:ListItem>
                                    <asp:ListItem Text="Student" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Staff" Value="2"></asp:ListItem>
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Survey Name:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <asp:TextBox runat="server" CssClass="validate[required]" ID="txtSurveyName" />
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Survey Description:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <CKEditor:CKEditorControl ID="txtSurveyDesc" BasePath="~/ckeditor" CssClass="validate[required]" runat="server"></CKEditor:CKEditorControl>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Survey Group:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <div class="selector">
                                <span runat="server" id="idGroup">Select Group Join Survey</span>
                                <asp:DropDownList AutoPostBack="true" OnSelectedIndexChanged="ddPlayer_SelectedIndexChanged" runat="server" CssClass="validate[required]" ID="ddPlayer">
                                    <asp:ListItem Selected="True" Text="Select Group Join Survey" Value="-1"></asp:ListItem>
                                    <asp:ListItem Text="Student" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Staff" Value="2"></asp:ListItem>
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Survey Image:</label>
                        </div>
                        <div class="grid9">
                            <asp:Image runat="server" ID="imageSurvey" Width="100" Height="100" />
                            <asp:FileUpload runat="server" CssClass="validate[required]" ID="fuImages" />
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Start Date:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <asp:Calendar OnDayRender="startDate_DayRender" OnSelectionChanged="startDate_SelectionChanged" runat="server" ID="startDate" BackColor="White" BorderColor="#999999" CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Height="180px" Width="200px">
                                <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                                <NextPrevStyle VerticalAlign="Bottom" />
                                <OtherMonthDayStyle ForeColor="#808080" />
                                <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                                <SelectorStyle BackColor="#CCCCCC" />
                                <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                                <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                                <WeekendDayStyle BackColor="#FFFFCC" />
                            </asp:Calendar>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Dead Line:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <asp:Calendar OnDayRender="deadLine_DayRender" runat="server" ID="deadLine" BackColor="White" BorderColor="#999999" CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Height="180px" Width="200px">
                                <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                                <NextPrevStyle VerticalAlign="Bottom" />
                                <OtherMonthDayStyle ForeColor="#808080" />
                                <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                                <SelectorStyle BackColor="#CCCCCC" />
                                <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                                <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                                <WeekendDayStyle BackColor="#FFFFCC" />
                            </asp:Calendar>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label><span class="req"></span></label>
                        </div>
                        <div class="grid9">
                            <asp:Button ID="submitEdit" Text="Update Survey Info" OnClick="submitEdit_Click" runat="server" CssClass="buttonS bLightBlue" />
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
    <div class="pagination">
        <asp:Repeater ID="totalPage" runat="server">
            <HeaderTemplate>
                <ul class="pages">
                    <li class="prev">
                        <asp:LinkButton runat="server" ID="btPrev" OnClick="btPrev_Click">&lt;</asp:LinkButton></li>
            </HeaderTemplate>
            <ItemTemplate>
                <li>
                    <asp:LinkButton runat="server" ID="PageNumber" OnClick="PageNumber_Click" Text='<%# Container.DataItem.ToString() %>'></asp:LinkButton></li>
            </ItemTemplate>
            <FooterTemplate>
                <li class="next">
                    <asp:LinkButton runat="server" ID="btNext" OnClick="btPrev_Click">&gt;</asp:LinkButton></li>
                </ul>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    <div class="pagination">
        <asp:Button ID="createQuestion" runat="server" Text="Create New Question" CssClass="buttonS bLightBlue" OnClick="createQuestion_Click"/>
    </div>
    <div class="widget">
        <div class="whead">
            <h6>All Question</h6>
            <div class="clear"></div>
        </div>
        <asp:Repeater ID="allQuestion" runat="server" OnItemCommand="allQuestion_ItemCommand">
            <HeaderTemplate>
                <table cellpadding="0" cellspacing="0" width="100%" class="tDefault checkAll tMedia" id="checkAll">
                    <thead>
                        <tr>
                            <td width="50">ID</td>
                            <td class="sortCol">
                                <div>Question Detail<span></span></div>
                            </td>
                            <td class="sortCol">
                                <div>Answers<span></span></div>
                            </td>
                            <td class="sortCol">
                                <div>Question Type<span></span></div>
                            </td>
                            <td width="100">Actions</td>
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td><%# Eval("QuestionID") %></td>
                    <td class="textL"><%# Eval("QuestionDetail").ToString().Length < 100 ?  Eval("QuestionDetail").ToString().Substring(5,Eval("QuestionDetail").ToString().Length-6) : Eval("QuestionDetail").ToString().Substring(5,94)+" ..."%></td>
                    <td class="textL"><%# Convert.ToInt32(Eval("QuestionTypeID")) == 2 ?  Eval("Answers") : Eval("Answers").ToString().Length < 100 ?  Eval("Answers").ToString().Substring(5,Eval("Answers").ToString().Length-6) : Eval("Answers").ToString().Substring(5,94)+" ..."%></td>
                    <td class="textL">
                        <asp:Label ID="lbStatus" runat="server" Text='<%# Eval("QuestionTypeID").ToString() == "1" ? "RadioButton Question" : Eval("QuestionTypeID").ToString() == "2" ? "Comment Question" : "CheckBox Question"%>'></asp:Label></td>
                    <td class="tableActs">
                        <asp:ImageButton ID="ibEditQuestion" CommandName="Edit" CommandArgument='<%# Eval("QuestionID") %>' Width="11px" Height="11px" ImageUrl="~/App_Themes/Administrator/images/icons/update.png" runat="server" CssClass="tablectrl_small bDefault tipS" title="Edit"></asp:ImageButton>
                        <asp:ImageButton ID="ibDeleteQuestion" CommandName="Delete" Width="11px" Height="11px" OnClientClick="return confirm('Are you sure that you want to delete this question?');" CommandArgument='<%# Eval("QuestionID") %>' ImageUrl="~/App_Themes/Administrator/images/icons/delete.png" runat="server" CssClass="tablectrl_small bDefault tipS" title="Remove"></asp:ImageButton>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
</asp:Content>
